main() {
  Dog dog = Dog();
  dog.eat();
  dog.sleep();
  Cat cat = Cat();
  cat.eat();
  cat.sleep();
}

//定义一个抽象类
abstract class Animal {
  void eat();
  void sleep();
}

//定义一个实现类
class Dog extends Animal {
  void eat() {
    print("狗在吃骨头");
  }

  void sleep() {
    print("狗在睡觉");
  }
}

//定义一个实现类
class Cat extends Animal {
  void eat() {
    print("猫在吃鱼");
  }

  void sleep() {
    print("猫在睡觉");
  }
}
